package ai.people.netmon.framework.domain.archives.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 *
 * 用户和档案关联
 *
 * @author zhenglin
 * @since 2022-03-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@TableName(schema = "webservice",value = "person_archives_user_association")
public class ArchivesUserAssociation implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     * @mock 1
     * @ignore
     */
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;

    /**
     * 基本信息ID
     * @mock 1
     */
    @NotNull(message = "档案id为空")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long archivesId;

    /**
     * 用户ID
     * @mock 1
     */
    @NotNull(message = "用户id为空")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long userId;

    public ArchivesUserAssociation(Long archivesId, Long userId) {
        this.archivesId = archivesId;
        this.userId = userId;
    }
}
